package com.token.sysflow.enumerate;

/**
 * 环节办理人的类型
 */
public enum StepApproverTypeEnum {
    PERSON(1,"ApproverPeople"),
    POST(2,"ApproverPost"),
    ROLE(3,"ApproverRole"),
    FIELD(4,"ApproverField"),
    STEP(5,""),
    ORG(6,""),
    FUNCTION(7,""),
    FORMULA(8,"");




    private final int id;
    private final String fieldname;
    StepApproverTypeEnum(int id, String name) {
        this.id = id;
        this.fieldname = name;
    }


    public int getId() {
        return id;
    }

    public String getFieldName(){
        return fieldname;
    }

    public static StepApproverTypeEnum getTypeByValue(int value){
        for (StepApproverTypeEnum enums : StepApproverTypeEnum.values()) {
            if (enums.getId()==value) {
                return enums;
            }
        }
        return null;
    }
}